<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>


    <style>
        .a {
            width: 100px;
            height: 100px;
            background-color: #000;
        }

        :root {
            --animate-duration: 1s;
            --animate-delay: 1s;
            --animate-repeat: 1
        }

        .animate__animated {
            -webkit-animation-duration: 1s;
            animation-duration: 1s;
            -webkit-animation-duration: var(--animate-duration);
            animation-duration: var(--animate-duration);
            -webkit-animation-fill-mode: both;
            animation-fill-mode: both
        }


        @-webkit-keyframes rubberBand {
            0% {
                -webkit-transform: scaleX(1);
                transform: scaleX(1)
            }

            30% {
                -webkit-transform: scale3d(1.25, .75, 1);
                transform: scale3d(1.25, .75, 1)
            }

            40% {
                -webkit-transform: scale3d(.75, 1.25, 1);
                transform: scale3d(.75, 1.25, 1)
            }

            50% {
                -webkit-transform: scale3d(1.15, .85, 1);
                transform: scale3d(1.15, .85, 1)
            }

            65% {
                -webkit-transform: scale3d(.95, 1.05, 1);
                transform: scale3d(.95, 1.05, 1)
            }

            75% {
                -webkit-transform: scale3d(1.05, .95, 1);
                transform: scale3d(1.05, .95, 1)
            }

            to {
                -webkit-transform: scaleX(1);
                transform: scaleX(1)
            }
        }

        @keyframes rubberBand {
            0% {
                -webkit-transform: scaleX(1);
                transform: scaleX(1)
            }

            30% {
                -webkit-transform: scale3d(1.25, .75, 1);
                transform: scale3d(1.25, .75, 1)
            }

            40% {
                -webkit-transform: scale3d(.75, 1.25, 1);
                transform: scale3d(.75, 1.25, 1)
            }

            50% {
                -webkit-transform: scale3d(1.15, .85, 1);
                transform: scale3d(1.15, .85, 1)
            }

            65% {
                -webkit-transform: scale3d(.95, 1.05, 1);
                transform: scale3d(.95, 1.05, 1)
            }

            75% {
                -webkit-transform: scale3d(1.05, .95, 1);
                transform: scale3d(1.05, .95, 1)
            }

            to {
                -webkit-transform: scaleX(1);
                transform: scaleX(1)
            }
        }

        .animate__rubberBand {
            -webkit-animation-name: rubberBand;
            animation-name: rubberBand
        }
    </style>
</head>

<body>


    <div class="a animate__animated ">111</div>

    <script>

        const oDiv = document.querySelector('.a')
        oDiv.onmouseover = function () {
            this.classList.add('animate__rubberBand')
        }
        oDiv.onmouseout = function () {
            this.classList.remove('animate__rubberBand')
        }
    </script>

</body>

</html>